<ion-header>
  <ion-navbar>
    <ion-title>物料申请</ion-title>
  </ion-navbar>
</ion-header>

<ion-content>
  <div class="w12 pb50">
    <ng-container *ngIf="BJ=='1'">
      <ion-list>
        <ion-item>
          <ion-label class="width100">客户姓名</ion-label>
          <ion-input type="text" [(ngModel)]="name" readonly="true"></ion-input>
        </ion-item>
        <ion-item>
          <ion-label class="width100">客户电话</ion-label>
          <ion-input type="number" [(ngModel)]="phone" readonly="true"></ion-input>
        </ion-item>
        <ion-item>
          <ion-label class="width100">客户地址</ion-label>
          <ion-input type="text" [(ngModel)]="address" readonly="true"></ion-input>
        </ion-item>
        <ion-item>
          <ion-label>保修类型</ion-label>
          <ion-select [(ngModel)]="safe" interface="popover">
            <ion-option value="0">保内</ion-option>
            <ion-option value="1">保外</ion-option>
            <ion-option value="2">延保</ion-option>
          </ion-select>
        </ion-item>
        <ion-item *ngIf="number">
          <ion-label class="width100">工单号</ion-label>
          <ion-input type="text" [(ngModel)]="number" readonly="true"></ion-input>
        </ion-item>
      </ion-list>
    </ng-container>
  </div>

  <div class="w12" style="margin-bottom: 60px;">
    <div class="w12 bgcolor_white">
      <div class="w12 lh30 pl15 pr15 pt10 pb5 font_size_large border_bottom">
        <span class="w10">固有费用选项</span>
        <span class="w02 font_blue tr" (click)="showMaterialModal()">新增+</span>
      </div>
      <div class="w12 bgcolor_white lh25 plr15 font_size_standard" style="border-top:1px solid #f1f1f1"
           *ngFor="let cost of fixedCosts.concat(materialCosts)">
        <div class="w12 pt5 pb10">
          <div class="w12">
            <span class="w10 font_size_large">{{cost.PRODUCT_NAME}}</span>
            <span class="w02 tr font_gray">单位:{{cost.AMOUNT_UOM_ID}}</span>
          </div>
          <div class="w12 mt5">
            <span class="w06 font_red font_size_large">￥{{cost.PRICE}}</span>
            <div class="num_p_m fr">
              <button class="p fl" *ngIf="cost.QUANTITY>0" (click)="quantityChange(cost,0)">
                <span>-</span>
              </button>
              <input class="fl" type="number" style="width: 45px" [value]="cost.QUANTITY" [(ngModel)]="cost.QUANTITY"
                     (keydown)="kdqc($event,cost)" (blur)="eqc(cost)">
              <button class="fl button button-md button-default button-default-md"
                      (click)="quantityChange(cost,1)">
                <span>+</span>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</ion-content>

<ion-footer>
  <div class="cart_footer">
    <div class="fl pl5 pr5">
      <h3 class="w12">
        <span class="fl">合计:</span>
        <div class="footer_pic fl">
          <span class="fl">￥</span>
          <b class="fl">{{ sum | money }}</b>
        </div>
      </h3>
    </div>
    <button class="w04 add_ljgm_btn fr" (click)="onSubmit()">
      <span class="button-inner">确定</span>
    </button>
  </div>
</ion-footer>
